package com.rainy.generator.service.impl;

import com.rainy.generator.dao.PathDao;
import com.rainy.generator.entity.PathEntity;
import com.rainy.generator.entity.PathQuery;
import com.rainy.generator.service.PathService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author liuqin on 2017/12/16
 */
@Service("pathService")
public class PathServiceImpl implements PathService{

    @Resource
    private PathDao pathDao;

    @Override
    public PathEntity queryPathByDb(String database) {
        return pathDao.queryPathByDb(database);
    }

    @Override
    public PathEntity queryPathById(Long id) {
        return pathDao.queryPathById(id);
    }

    @Override
    public PathEntity queryPath() {
        return this.queryPathByDb(null);
    }

    @Override
    public List<PathEntity> queryPaths(PathQuery pathQuery) {
        return pathDao.queryPaths(pathQuery);
    }

    @Override
    public Long queryCount(PathQuery pathQuery) {
        return pathDao.queryCount(pathQuery);
    }

    @Override
    public void update(PathEntity pathEntity) {
        pathDao.update(pathEntity);
    }

    @Override
    public void save(PathEntity pathEntity) {
        pathDao.save(pathEntity);
    }

    @Override
    public void delete(Long id) {
        pathDao.delete(id);
    }
}
